package com.dime.physical.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dime.physical.mapper.DimeBasepackagecombMapper;
import com.dime.physical.domain.DimeBasepackagecomb;
import com.dime.physical.service.IDimeBasepackagecombService;

/**
 * 套餐明细Service业务层处理
 * 
 * @author Tiny
 * @date 2023-09-14
 */
@Service
public class DimeBasepackagecombServiceImpl implements IDimeBasepackagecombService 
{
    @Autowired
    private DimeBasepackagecombMapper dimeBasepackagecombMapper;

    /**
     * 查询套餐明细
     * 
     * @param id 套餐明细主键
     * @return 套餐明细
     */
    @Override
    public DimeBasepackagecomb selectDimeBasepackagecombById(String id)
    {
        return dimeBasepackagecombMapper.selectDimeBasepackagecombById(id);
    }

    /**
     * 查询套餐明细列表
     * 
     * @param dimeBasepackagecomb 套餐明细
     * @return 套餐明细
     */
    @Override
    public List<DimeBasepackagecomb> selectDimeBasepackagecombList(DimeBasepackagecomb dimeBasepackagecomb)
    {
        return dimeBasepackagecombMapper.selectDimeBasepackagecombList(dimeBasepackagecomb);
    }

    /**
     * 新增套餐明细
     * 
     * @param dimeBasepackagecomb 套餐明细
     * @return 结果
     */
    @Override
    public int insertDimeBasepackagecomb(DimeBasepackagecomb dimeBasepackagecomb)
    {

        dimeBasepackagecomb.setId(IdUtils.fastUUID());
        dimeBasepackagecomb.setCreateBy(SecurityUtils.getUsername());
        dimeBasepackagecomb.setCreateTime(DateUtils.getNowDate());
        return dimeBasepackagecombMapper.insertDimeBasepackagecomb(dimeBasepackagecomb);
    }

    /**
     * 修改套餐明细
     * 
     * @param dimeBasepackagecomb 套餐明细
     * @return 结果
     */
    @Override
    public int updateDimeBasepackagecomb(DimeBasepackagecomb dimeBasepackagecomb)
    {
        dimeBasepackagecomb.setUpdateTime(DateUtils.getNowDate());
        dimeBasepackagecomb.setUpdateBy(SecurityUtils.getUsername());
        return dimeBasepackagecombMapper.updateDimeBasepackagecomb(dimeBasepackagecomb);
    }

    /**
     * 批量删除套餐明细
     * 
     * @param ids 需要删除的套餐明细主键
     * @return 结果
     */
    @Override
    public int deleteDimeBasepackagecombByIds(String[] ids)
    {
        return dimeBasepackagecombMapper.deleteDimeBasepackagecombByIds(ids);
    }

    /**
     * 删除套餐明细信息
     * 
     * @param id 套餐明细主键
     * @return 结果
     */
    @Override
    public int deleteDimeBasepackagecombById(String id)
    {
        return dimeBasepackagecombMapper.deleteDimeBasepackagecombById(id);
    }
}
